package com.common.www.controller;

import com.common.www.bean.entity.Result;
import com.common.www.service.redis.RedisTemplateService;
import com.common.www.utils.R;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@CrossOrigin()
@Api(tags = "API IP管理接口")
@RequestMapping(value = {"/api/ip/"})
public class IpController {

    @Autowired
    RedisTemplateService redisTemplateService1;


    @ApiOperation("查询设备的ip地址")
    @ApiImplicitParams({
    })
    @RequestMapping(value = "/getDeviceIp", method = {RequestMethod.POST, RequestMethod.GET})
    public Result getDeviceIp(HttpServletRequest request) {
//        String ip = IpUtil.getIpAddr(request);
        String ip = "111.192.15.0";
        return R.ok(ip);//模拟北京的ip
    }


}
